/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package server;

import java.util.Hashtable;

import client.ClientOd;

/**
 *
 * @author Qiao Bingzhi
 */
public class ServerManager {
    
    private Hashtable listClients =new Hashtable();
    
    
    public boolean existClient(String id)
    {
         if(this.listClients.containsKey(id))
         {
            return true;
         }
         else
         {
             return false;
         }    
    
    }       
    
    
    public boolean addClient(String id,ClientOd client)
      {
              if(this.existClient(id))
              {
                  return false;
              }
              else
              {
                 this.listClients.put(id,client);
                 return true;
              }    
      
      }
      public boolean removeClient(String id)
      {
             if(this.existClient(id))
             {
                this.listClients.remove(id);
                return true;
             }
             else
             {
                return false;
             }        
      }
      
      public ClientOd getClient(String id)
      {
          return (ClientOd) this.listClients.get(id);     
      }        
    
}
